
import service from '@/utils/request'


// 获取数据列表

export function getData(params) {
    return service({
        url: '/account/selectCommodityPage',
        method: 'get',
        params
    })
}

// 新增商品-回显商品分类
export function getCategory(params) {
    return service({
        url: `account/selectCommodityCategory`,
        method: 'get',
        params
    })
}

// 新增商品
export function addCommodity(data) {
    return service({
        url: 'account/insertCommodity',
        method: 'post',
        data
    })
}

// 修改商品
export function updateCommodity(data) {
    return service({
        url: 'account/updateCommodityById',
        method: 'put',
        data //不能用data
    })
}

// 删除商品
export function delCommodity(params) {
    return service({
        url: '/account/deleteCommodityById',
        method: 'delete',
        params
    })
}